/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package business;

import java.util.Random;

/**
 *
 * @author stana
 */
public class CodeGenerator {
    public static int sendCode(String phoneNumber)
    {
        int actualCode;
        SmsGateway gateway = new O2Gateway();
        actualCode = generateCode();
        gateway.sendSms("vas validacni kod:" + actualCode, phoneNumber);
        return actualCode;

    }
    private static int generateCode()
    {
        Random randomGenerator = new Random();
        int randomInt = randomGenerator.nextInt(10000);
        return randomInt;
    }

}
